package com.vin.service.impl;

import com.vin.mapper.UserMapper;
import com.vin.pojo.User;
import com.vin.service.UserService;
import com.vin.utils.MD5Utils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserMapper userMapper;
    @Override
    public User findByUserName(String username) {
       User u =  userMapper.findIdByUserName(username);
        return u;
    }

    @Override
    public void register(String userName, String password) {
            String md5String = MD5Utils.getMD5String(password);
         userMapper.add(userName,md5String);
    }
}
